#include <QDialog>

#include "degreedialog.h"

namespace ReductionMethods
{
    enum DegreeReductionMethod
    {
	Error,		// = 0
	Simple,		// = 1
	Hermite,	// = 2
	Approx,		// = 3
	LewanowiczWozny	// = 4
    };
}

DegreeDialog::DegreeDialog(QWidget *parent) :
    QDialog(parent)
{
    setupUi(this);
}

DegreeDialog::~DegreeDialog()
{
}

void DegreeDialog::on_reduceButton_clicked()
{
    int method, degree;

    if ( simpleRadio->isChecked( ) )
        method = ReductionMethods::Simple;
    else if ( hermiteRadio->isChecked( ) )
        method = ReductionMethods::Hermite;
    else if ( approxRadio->isChecked( ) )
        method = ReductionMethods::Approx;
    else if ( lwRadio->isChecked( ) )
        method = ReductionMethods::LewanowiczWozny;
    else
        method = ReductionMethods::Error;

    degree = degreeSpinBox -> value( );

    emit reduceDegree( method, degree );
}
